<?php

class UserHelper {
  static function sendRetrieveMail($options){
    // manda el mail de recuperar contraseña
    
    $options['URL'] = HTMLHelper::absoluteRoot(1).'user/reset/t_'.$options['token'].'/mail_'.$options['mail'];
    
    $keys = array_keys($options);
    $vals = array_values($options);
    foreach($keys as $k => $v){
        $keys[$k] = '{'.$v.'}';
    }
    
    mail(
      $options['mail'],
      'Instrucciones para cambiar su clave de acceso a Spatia',
      str_replace($keys, $vals, file_get_contents($options['template'])) ."\n",
      "from: ".Config::get('send_mails_from','info@spatiavedemecum.com')
    );
  }
}